package com.game.service;

import com.game.dao.UserDao;
import com.game.entity.User;

public class UserService {
    UserDao userDao;

    public UserService() {
        userDao = new UserDao();
    }
    // 三目运算符, 三元运算符  表达式 ? 代码1 : 代码2 ;
    public String login(User user) {
        try {
            return userDao.login(user) == 1 ? "登陆成功" : "您输入的用户名和密码错误,请重新输入";
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }
}
